package com.data.monitoring.model.DTO;

import com.data.monitoring.model.ENUM.AuthMethod;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

// DTO定义
@Data
public class ServerDTO {
    @NotBlank
    private String serverName;

    @NotBlank
    @Pattern(regexp = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
    private String ipAddress;

    @Range(min = 1, max = 65535)
    private Integer sshPort;

    @NotBlank
    private String username;

    private String authMethod;

    // 根据authMethod使用其中一个字段
    private String password;
    private String privateKey;
}